<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class RubyVM - RDoc Documentation</title>


<script src="./js/navigation.js" defer></script>
<script src="./js/search.js" defer></script>
<script src="./js/search_index.js" defer></script>
<script src="./js/searcher.js" defer></script>
<script src="./js/darkfish.js" defer></script>

<script src="./js/jquery-3.2.0.min.js"></script>

<script src="./js/vue.min.js"></script>
<script src="./js/js.cookie.min.js"></script>

<link href="./css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="./css/rdoc.css" rel="stylesheet">
<link href="./css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
  var index_rel_prefix = "./";
  var darkModeCsseHref = "./css/rdoc-dm.css"
  var defaultModeCssHref = "./css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0-preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="./index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="./table_of_contents.html#pages">Pages</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-each_builtin">::each_builtin</a>
    <li ><a href="#method-c-keep_script_lines">::keep_script_lines</a>
    <li ><a href="#method-c-keep_script_lines-3D">::keep_script_lines=</a>
    <li ><a href="#method-c-mtbl">::mtbl</a>
    <li ><a href="#method-c-mtbl2">::mtbl2</a>
    <li ><a href="#method-c-stat">::stat</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-RubyVM">
    <h1 id="class-RubyVM" class="class">
      class RubyVM
    </h1>

    <section class="description">
    
<p>The <a href="RubyVM.html"><code>RubyVM</code></a> module only exists on MRI. <code>RubyVM</code> is not defined in other Ruby implementations such as JRuby and TruffleRuby.</p>

<p>The <a href="RubyVM.html"><code>RubyVM</code></a> module provides some access to MRI internals. This module is for very limited purposes, such as debugging, prototyping, and research.  Normal users must not use it. This module is not portable between Ruby implementations.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="DEFAULT_PARAMS">DEFAULT_PARAMS
          <dd><p><a href="RubyVM.html#DEFAULT_PARAMS"><code>DEFAULT_PARAMS</code></a> This constant exposes the VM’s default parameters. Note that changing these values does not affect VM execution. Specification is not stable and you should not depend on this value. Of course, this constant is MRI specific.</p>
          <dt id="INSTRUCTION_NAMES">INSTRUCTION_NAMES
          <dd><p><a href="RubyVM.html#INSTRUCTION_NAMES"><code>INSTRUCTION_NAMES</code></a> A list of bytecode instruction names in MRI. This constant is MRI specific.</p>
          <dt id="OPTS">OPTS
          <dd><p><a href="RubyVM.html#OPTS"><code>OPTS</code></a> An <a href="Array.html"><code>Array</code></a> of VM build options. This constant is MRI specific.</p>
        </dl>
        </section>



                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-each_builtin" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">each_builtin</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="each_builtin-source">
            <pre>static VALUE
each_builtin(VALUE self)
{
    st_foreach(loaded_builtin_table, each_builtin_i, 0);
    return Qnil;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-keep_script_lines" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          keep_script_lines &rarr; true or false
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Return current <code>keep_script_lines</code> status. Now it only returns <code>true</code> of <code>false</code>, but it can return other objects in future.</p>

<p>Note that this is an API for ruby internal use, debugging, and research. Do not use this for any other purpose. The compatibility is not guaranteed.</p>

                              <div class="method-source-code" id="keep_script_lines-source">
            <pre>static VALUE
vm_keep_script_lines(VALUE self)
{
    return RBOOL(ruby_vm_keep_script_lines);
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-keep_script_lines-3D" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          keep_script_lines = true / false
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>It set <code>keep_script_lines</code> flag. If the flag is set, all loaded scripts are recorded in a interpreter process.</p>

<p>Note that this is an API for ruby internal use, debugging, and research. Do not use this for any other purpose. The compatibility is not guaranteed.</p>

                              <div class="method-source-code" id="keep_script_lines-3D-source">
            <pre>static VALUE
vm_keep_script_lines_set(VALUE self, VALUE flags)
{
    ruby_vm_keep_script_lines = RTEST(flags);
    return flags;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-mtbl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">mtbl</span><span
                                class="method-args">(p1, p2)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="mtbl-source">
            <pre>static VALUE
vm_mtbl(VALUE self, VALUE obj, VALUE sym)
{
    vm_mtbl_dump(CLASS_OF(obj), RTEST(sym) ? SYM2ID(sym) : 0);
    return Qnil;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-mtbl2" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">mtbl2</span><span
                                class="method-args">(p1, p2)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="mtbl2-source">
            <pre>static VALUE
vm_mtbl2(VALUE self, VALUE obj, VALUE sym)
{
    vm_mtbl_dump(obj, RTEST(sym) ? SYM2ID(sym) : 0);
    return Qnil;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-stat" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          stat &rarr; Hash
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          stat(hsh) &rarr; hsh
                              </span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          stat(Symbol) &rarr; Numeric
                              </span>
                            </div>

                            <div class="method-description">
                              <p>Returns a <a href="Hash.html"><code>Hash</code></a> containing implementation-dependent counters inside the VM.</p>

<p>This hash includes information about method/constant caches:</p>

<pre class="ruby">{
  <span class="ruby-value">:constant_cache_invalidations</span><span class="ruby-operator">=&gt;</span><span class="ruby-value">2</span>,
  <span class="ruby-value">:constant_cache_misses</span><span class="ruby-operator">=&gt;</span><span class="ruby-value">14</span>,
  <span class="ruby-value">:global_cvar_state</span><span class="ruby-operator">=&gt;</span><span class="ruby-value">27</span>
}
</pre>

<p>If <code>USE_DEBUG_COUNTER</code> is enabled, debug counters will be included.</p>

<p>The contents of the hash are implementation specific and may be changed in the future.</p>

<p>This method is only expected to work on C Ruby.</p>

                              <div class="method-source-code" id="stat-source">
            <pre>static VALUE
vm_stat(int argc, VALUE *argv, VALUE self)
{
    static VALUE sym_constant_cache_invalidations, sym_constant_cache_misses, sym_global_cvar_state, sym_next_shape_id;
    VALUE arg = Qnil;
    VALUE hash = Qnil, key = Qnil;

    if (rb_check_arity(argc, 0, 1) == 1) {
        arg = argv[0];
        if (SYMBOL_P(arg))
            key = arg;
        else if (RB_TYPE_P(arg, T_HASH))
            hash = arg;
        else
            rb_raise(rb_eTypeError, &quot;non-hash or symbol given&quot;);
    }
    else {
        hash = rb_hash_new();
    }

#define S(s) sym_##s = ID2SYM(rb_intern_const(#s))
    S(constant_cache_invalidations);
    S(constant_cache_misses);
        S(global_cvar_state);
    S(next_shape_id);
#undef S

#define SET(name, attr) \
    if (key == sym_##name) \
        return SERIALT2NUM(attr); \
    else if (hash != Qnil) \
        rb_hash_aset(hash, sym_##name, SERIALT2NUM(attr));

    SET(constant_cache_invalidations, ruby_vm_constant_cache_invalidations);
    SET(constant_cache_misses, ruby_vm_constant_cache_misses);
    SET(global_cvar_state, ruby_vm_global_cvar_state);
    SET(next_shape_id, (rb_serial_t)GET_SHAPE_TREE()-&gt;next_shape_id);
#undef SET

#if USE_DEBUG_COUNTER
    ruby_debug_counter_show_at_exit(FALSE);
    for (size_t i = 0; i &lt; RB_DEBUG_COUNTER_MAX; i++) {
        const VALUE name = rb_sym_intern_ascii_cstr(rb_debug_counter_names[i]);
        const VALUE boxed_value = SIZET2NUM(rb_debug_counter[i]);

        if (key == name) {
            return boxed_value;
        }
        else if (hash != Qnil) {
            rb_hash_aset(hash, name, boxed_value);
        }
    }
#endif

    if (!NIL_P(key)) { /* matched key should return above */
        rb_raise(rb_eArgError, &quot;unknown key: %&quot;PRIsVALUE, rb_sym2str(key));
    }

    return hash;
}</pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

